import Vue from 'vue'
import Router from 'vue-router'
import Index from './views/index'

import http from './common/http'
import store from './store'
Vue.use(Router)

let r = new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      component: Index,
      children : [
        {
          path: '/dictlist',
          name: 'dictlist',
          component: () => import('./views/dictlist/index.vue')
        },
        {
          path: '/updatePassword',
          name: 'updatePassword',
          component: () => import('./views/updatePassword/index.vue')
        },
        {
          path: '/dashboard',
          name: 'dashboard',
          component: () => import('./views/dashboard/index.vue')
        },
        {
          path: '/role',
          name: 'role',
          component: () => import('./views/role/index.vue')
        },
        {
          path: '/menu',
          name: 'menu',
          component: () => import('./views/menu/index.vue')
        },
        {
          path: '/user',
          name: 'user',
          component: () => import('./views/user/index.vue')
        },
        {
          path: '/mechanism',
          name: 'mechanism',
          component: () => import('./views/mechanism/index.vue')
        },
        //社区基本信息
        {
          path: '/community',
          name: 'community',
          component: () => import('./views/community/community.vue')
        },
        //社区工作者绩效考核
        {
          path: '/communityworkers',
          name: 'communityworkers',
          component: () => import('./views/community/communityworkers.vue')
        },
        //社区资源
        {
          path: '/communityResources',
          name: 'communityResources',
          component: () => import('./views/community/communityResources.vue')
        },
        //社区回应
        {
          path: '/communityResponse',
          name: 'communityResponse',
          component: () => import('./views/community/communityResponse.vue')
        },
        //社区回应
        {
          path: '/communityEvaluation',
          name: 'communityEvaluation',
          component: () => import('./views/community/communityEvaluation.vue')
        },
        //社区动员
        {
          path: '/communityMobilization',
          name: 'communityMobilization',
          component: () => import('./views/community/communityMobilization.vue')
        },
        //机构
        {
          path: '/company',
          name: 'company',
          component: () => import('./views/company/index.vue')
        },
        //模板
        {
          path: '/model',
          name: 'model',
          component: () => import('./views/model/index.vue')
        },
        //分配专家账号
        {
          path: '/expertAccount',
          name: 'expertAccount',
          component: () => import('./views/expertaccount/index.vue')
        },
        //方案申报
        {
          path: '/report',
          name: 'report',
          component: () => import('./views/report/index.vue')
        },
        {
          /*方案*/
          path: '/plan',
          name: 'plan',
          component: () => import('./views/scheme/index')
        },
        {
          /*方案*/
          path: '/score',
          name: 'score',
          component: () => import('./views/score/index')
        },
        {
          /*民政评估*/
          path: '/assessment',
          name: 'assessment',
          component: () => import('./views/assessment/index')
        },
        {
          /*评价统计*/
          path: '/evaluationStatistics',
          name: 'evaluationStatistics',
          component: () => import('./views/community/evaluationStatistics.vue')
        },
        {
          /*议事记录*/
          path: '/proceedings',
          name: 'proceedings',
          component: () => import('./views/proceedings/index')
        },
        // {
        //   /*机构数量*/
        //   path: '/quantityNum',
        //   name: 'quantityNum',
        //   component: () => import('./views/quantityNum/index')
        // },
        // {
        //   /*社区事件*/
        //   path: '/communityEvents',
        //   name: 'communityEvents',
        //   component: () => import('./views/community/communityEvents.vue')
        // },
        {
          /*社区地图*/
          path: '/communityMap',
          name: 'communityMap',
          component: () => import('./views/community/communityMap.vue')
        },

        {
          /*信息发布*/
          path: '/InformationDelivery',
          name: 'InformationDelivery',
          component: () => import('./views/society/InformationDelivery.vue')
        },
        {
          /*在线登记*/
          path: '/registration',
          name: 'registration',
          component: () => import('./views/society/registration.vue')
        },
        {
          /*社会救助*/
          path: '/assistance',
          name: 'assistance',
          component: () => import('./views/society/assistance.vue')
        },
        {
          /*社会活动*/
          path: '/activities',
          name: 'activities',
          component: () => import('./views/society/activities.vue')
        },
        {
          /*转件申请*/
          path: '/transfer',
          name: 'transfer',
          component: () => import('./views/society/transfer.vue')
        },
        {
          /*移动寻亲*/
          path: '/searchpeople',
          name: 'searchpeople',
          component: () => import('./views/search/searchpeople.vue')
        },
        {
          /*寻亲、寻家信息登记*/
          path: '/searchregist',
          name: 'searchregist',
          component: () => import('./views/search/searchregist.vue')
        },
        {
          /*寻亲、寻家信息查询*/
          path: '/searchinfomation',
          name: 'searchinfomation',
          component: () => import('./views/search/searchinfomation.vue')
        },
        {
          /*寻人线索管理*/
          path: '/clue',
          name: 'clue',
          component: () => import('./views/search/clue.vue')
        },
        {
          /*信息发布*/
          path: '/releaseinfomation',
          name: 'releaseinfomation',
          component: () => import('./views/search/releaseinfomation.vue')
        },
        {
          /*救助人员档案管理*/
          path: '/archives',
          name: 'archives',
          component: () => import('./views/search/archives.vue')
        },
        {
          /*网上实名注册*/
          path: '/volunteerregister',
          name: 'volunteerregister',
          component: () => import('./views/volunteer/volunteerregister.vue')
        },
        {
          /*活动搜索报名*/
          path: '/volunteeractivity',
          name: 'volunteeractivity',
          component: () => import('./views/volunteer/volunteeractivity.vue')
        },
        {
          /*服务时间记录*/
          path: '/volunteertime',
          name: 'volunteertime',
          component: () => import('./views/volunteer/volunteertime.vue')
        },
        {
          /*服务时间记录*/
          path: '/registrationaudit',
          name: 'registrationaudit',
          component: () => import('./views/volunteer/registrationaudit.vue')
        },
        {
          /*考核指标管理*/
          path: '/target',
          name: 'target',
          component: () => import('./views/target/target.vue')
        },
        {
          /*考核方案管理*/
          path: '/checkplan',
          name: 'checkplan',
          component: () => import('./views/target/checkplan.vue')
        },
        {
          /*社会力量注册*/
          path: '/socialforces',
          name: 'socialforces',
          component: () => import('./views/volunteer/socialforces.vue')
        },
        {
          /*救助信息对接*/
          path: '/rescuedocking',
          name: 'rescuedocking',
          component: () => import('./views/volunteer/rescuedocking.vue')
        },
        {
          /*绩效考核监控*/
          path: '/monitor',
          name: 'monitor',
          component: () => import('./views/target/monitor.vue')
        },
        {
          /*电子监察*/
          path: '/situation',
          name: 'situation',
          component: () => import('./views/target/situation.vue')
        },
        {
          /*绩效考核统计*/
          path: '/appraisalstatistics',
          name: 'appraisalstatistics',
          component: () => import('./views/target/appraisalstatistics.vue')
        },
      ]

    },
    {
      /*登陆*/
      path: '/login',
      name: 'login',
      component: () => import('./views/login/index')
    },
    {
      /*测试*/
      path: '/test',
      name: 'test',
      component: () => import('./views/test')
    },
    {
      /*权限*/
      path: '/power',
      name: 'power',
      component: () => import('./views/power/index')
    },
  ]
})


r.beforeEach(async (to, from, next) => {

  if (to.meta.title) {
    document.title = to.meta.title;
  }
  next();

});



export default r;
